home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 October: Windmill on DISC / ADC Developer CD (1993-10) (''Windmill On DISC'')_iso / Dev.CD Oct 93.iso / Utilities / Installer v3.4.3 / Examples - Installer 3.4 / AddAuditTrail.r next >
Encoding:
Text File  |  1993-06-15  |  4.7 KB  |  132 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: adding an audit trail
  6.  *
  7.  *    File:        AddAuditTrail.r -    Rez Source
  8.  *
  9.  *  Modifications:
  10.  *        5/19/93: RRK Changed Target file spec typeCrMustMatch flag setting to
  11.  *                        typeCrNeedNotMatch and included comment that this will
  12.  *                        allow the replacement of the target file if for some reason
  13.  *                        the file or creator are different.
  14.  *                     Used InstallerCommon.r defines.
  15.  *
  16.  *    by:        Jon Zap
  17.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  18.  *
  19.  *    Copyright © 1991 Apple Computer, Inc.
  20.  *    All rights reserved.
  21.  *
  22.  *------------------------------------------------------------------------------
  23.  *
  24.  * Install "TeachText" into the folder "Root":Installed Application and then
  25.  * add an audit record to the system file.  
  26.  *----------------------------------------------------------------------------*/
  27.  
  28. #include "InstallerTypes.r"
  29. #include "InstallerCommon.r"
  30.  
  31. /* You can build and complete the script with the following lines:
  32. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  33. # or set up folders with the same names and contents as the floppies
  34. # put these folders in the same folder as the script or at the root directory of same disk
  35. # For demonstration purposes, the application TeachText is used as the sample
  36. # application on a disk named "Program Disk".  The script will install TeachText
  37. # into the folder "Installed Application:" at the root of the target disk.
  38.  
  39.     rez -o "AddAuditTrail" -t 'bbkr' -c 'bbkr' "AddAuditTrail.r"
  40.     setfile -a i "AddAuditTrail"        #mark Inited
  41.     scriptcheck -p "AddAuditTrail"
  42. */
  43.  
  44. /* Defines for the file spec atoms (specifications for source and destination files) */
  45. #define fsSourceProgram            2000
  46. #define fsTargetProgram            2001
  47. #define fsTargetSystem            2002
  48.  
  49. /* This is the name of the source disk */
  50. #define ProgramDisk "Program Disk:"
  51.  
  52. /* This is the target path for where we want to install the file. */
  53. #define TargetPath    ":Installed Application:"
  54.  
  55. /* Definition for the package. */
  56. #define pkTheProgram            3000
  57.  
  58. /* Definition for the file atom */
  59. #define faProgram                4000
  60.  
  61. /* Definition for the audit atom */
  62. #define atProgram                5000
  63. #define auditProgram            'MOOF'
  64. #define auditProgVer            2
  65.  
  66. /***************************** Package Resources ************************************************/
  67. resource 'inpk' (pkTheProgram) {
  68.     format0 {
  69.         showsOnCustom,             /* Package appears in the Custom Install display */
  70.         removable,                /* Package can be removed */
  71.         dontForceRestart,        /* adding an audit atom to system file doesn't require reboot */
  72.         0,                         /* 'icmt' not required */
  73.         0,                        /* Package size (filled in by ScriptCheck) */
  74.         "The Program audit", {        /* package name */
  75.             'infa', faProgram;
  76.             'inat', atProgram;
  77.         }
  78.     }
  79. };
  80.  
  81. /********************************************* File Specs ***************************************/
  82. /* Source File Specs */
  83. resource 'infs' (fsSourceProgram) {
  84.     'APPL',                                /* File Type for TeachText */
  85.     'ttxt',                                /* Creator for TeachText for 7.0 */
  86.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  87.     noSearchForFile,                    /* Do not search the source disk for the file */
  88.     typeCrMustMatch,                    /* file type and creator on this file must match */
  89.     ProgramDisk"TeachText"                /* Path to the file */
  90. };
  91.  
  92. /* Target File Specs */
  93. resource 'infs' (fsTargetProgram) {
  94.     'APPL',                                /* File Type for TeachText */
  95.     'ttxt',                                /* Creator for TeachText for 7.0 */
  96.     kNoDateStampCheck,                    /* creation date must be zero for target file spec */
  97.     noSearchForFile,                    /* Do not search the target disk for the file */
  98.     typeCrNeedNotMatch,                    /* file to be replaced even if F&C don't match  */
  99.     TargetPath"TeachText"                /* installation Path */
  100. };
  101.  
  102. resource 'infs' (fsTargetSystem) {
  103.     'ZSYS',                                /* File Type */
  104.     'MACS',                                /* Creator */
  105.     kNoDateStampCheck,                    /* creation date must be zero for target file spec */
  106.     noSearchForFile,                    /* Do not search the target disk for the file */
  107.     typeCrNeedNotMatch,                    /* file to be matched by name even if F&C don't match  */
  108.     "special-macs:System"                /* installation Path */
  109. };
  110.  
  111. /***************************************** File Atoms ************************************************/
  112. resource 'infa' (faProgram) {
  113.     format0 {
  114.         StdRemLeaveNewerCopy,            /* see InstallerCommon.r */
  115.         fsTargetProgram,                /* TARGET file spec */
  116.         fsSourceProgram,                 /* SOURCE file spec */
  117.         0,                                /* atom size (filled in by ScriptCheck) */
  118.         ""                                /* Atom Description (for a file Installer will use file name) */
  119.     };
  120. };
  121.  
  122. resource 'inat' (atProgram) {
  123.     format0 {
  124.         fsTargetSystem,
  125.         auditProgram,
  126.         auditProgVer
  127.     };
  128. };
  129.  
  130.  
  131.  
  132.